package com.wanxi.feign;

import com.wanxi.entity.User;
import com.wanxi.result.CommonResult;
import com.wanxi.vo.*;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "user-server",path = "/user")
public interface UserFeignClient {
    @ApiOperation(value = "添加用户接口",response = CommonResult.class)
    @PostMapping("/addUser")
    public CommonResult addUser(@RequestBody UserFrontDTO user);

    @ApiOperation(value = "用户停起用",response = CommonResult.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "用户id",required = true),
            @ApiImplicitParam(name = "State",value = "状态",required = true)
    })
    @PutMapping("/updateGuardianState")
    public CommonResult updateGuardianState(@RequestParam("id") Long id, @RequestParam("state") Integer state);

    @ApiOperation(value = "修改用户信息接口",response = CommonResult.class)
    @PostMapping("/perfectInformation")
    public CommonResult perfectInformation(@RequestBody UserInfoDTO user);

    @ApiOperation(value = "后台根据条件用户")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = User.class,responseContainer = "List")
    })
    @GetMapping("/getGuardianByCondition")
    public CommonResult getGuardianByCondition(@SpringQueryMap UserQuery userQuery);
    @ApiOperation(value = "前台查询用户")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = UserDTO.class,responseContainer = "List")
    })
    @GetMapping("/getUserFront")
    public CommonResult getUserFront(@SpringQueryMap UserQuery userQuery);

    @ApiOperation(value = "查询入驻状态接口",response = CommonResult.class)
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id" ,value = "用户id",required = true)
    )
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = DoctorDTO.class,responseContainer = "List")
    })
    @GetMapping("/findSettledStatus")
    public CommonResult findSettledStatus(@RequestParam("id") Long id);

    @ApiOperation(value = "切换医生接口",response = CommonResult.class)
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id" ,value = "用户id",required = true)
    )

    @PostMapping("/SwitchDoctor")
    //待定
    public CommonResult SwitchDoctor(@RequestParam("id") Long id);

    @ApiOperation(value = "登录接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneNumber",value = "手机号",required = true),
            @ApiImplicitParam(name = "password",value = "密码",required = true),
            @ApiImplicitParam(name = "code",value = "验证码",required = true)
    })
    @ApiResponse(code = 200,message = "登录成功",response = User.class)
    @PostMapping("/login")
    //
    //
    public CommonResult login(@RequestParam("phoneNumber") String phoneNumber,@RequestParam("password") String password,@RequestParam("code") String code);

    @ApiOperation(value = "修改密码",response = CommonResult.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "编号",required = true),
            @ApiImplicitParam(name = "password",value = "密码",required = true),
            @ApiImplicitParam(name = "newPassword",value = "新密码",required = true)
    })
    @PutMapping("/updatePassword")
    public CommonResult updatePassword(@RequestParam("id") Long id , @RequestParam("password") String password, @RequestParam("newPassword") String newPassword);
    @ApiOperation(value = "添加用户角色接口",response = CommonResult.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "用户id", required = true),
            @ApiImplicitParam(name = "roleId",value = "角色类型",required = true)
    })
    @PostMapping("/addUserRole")
    public CommonResult addRole(@RequestParam("id") Long id,@RequestParam("roleId") Integer roleId);


}
